package 异常;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
//多个异常分别处理
public class tryCatch1 {
    public static void main(String[] args) {
try {


    int[] arr = {1, 2, 3};
    System.out.println(arr[3]);
}catch (ArrayIndexOutOfBoundsException e)
{
    System.out.println(e);

}
try {


    List a = new ArrayList();
    a.add(1);
    a.add(2);
    a.add(3);
    Object o = a.get(3);
    System.out.println(0);
}catch (IndexOutOfBoundsException e){
    System.out.println(e);
}
    }
}
